package com.mornd.gulimall.member.service;

import com.mornd.gulimall.apis.member.to.MemberLoginTo;
import com.mornd.gulimall.apis.member.to.MemberRegistTo;
import com.mornd.gulimall.common.core.entity.SessionUser;
import com.mornd.gulimall.common.core.exception.ExistedException;
import com.mornd.gulimall.member.entity.Member;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 会员 服务类
 * </p>
 *
 * @author mornd
 * @since 2023-07-31
 */
public interface IMemberService extends IService<Member> {

    /**
     * 注册
     * @param to
     */
    void regist(MemberRegistTo to);

    /**
     * true表示唯一
     * @param phone
     * @return
     */
    void checkPhoneUnique(String phone) throws ExistedException;
    void checkUsernameUnique(String username) throws ExistedException;

    /**
     * 登录
     * @param to
     * @return
     */
    SessionUser login(MemberLoginTo to);
}
